import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.Scanner;

public class Demo01 {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        System.out.println("输入你的姓名");
        String name=sc.nextLine();
        System.out.println("输入你的工作");
        String job=sc.nextLine();
        System.out.println("输入你的工资");
        int sal=sc.nextInt();
        try (Connection conn=DBUtils.getConn();){
            String s="insert into myemp value(null,?,?,?)";
            PreparedStatement ps=conn.prepareStatement(s);
            ps.setString(1,name);
            ps.setString(2,job);
            ps.setInt(3,sal);
            ps.executeUpdate();
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
